package com.fcml.pattern.decorator;

/**
 * @author fcml
 * @date 2018/11/8
 *
 * 具体的Milk装饰者
 * 装饰者保存了一个被装饰者的引用。
 */
public class Milk extends CondimentDecorator {
    private Beverage beverage;

    public Milk(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Milk";
    }

    @Override
    public double cost() {
        return 5.55 + beverage.cost();
    }
}
